home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / fido / XPACK275.lha / rexx / XRMV.rexx < prev   
OS/2 REXX Batch file  |  1995-01-09  |  1KB  |  54 lines

  1. /**/
  2. v="$VER: Xrmv Rexx    Remove a file from a Site Queue Williamson 55.02"
  3. options results
  4. options failat 99
  5. signal on syntax
  6. signal on halt
  7. signal on ioerr
  8. signal on break_c
  9. signal on break_d
  10.  
  11. if ~show('L', "rexxsupport.library") then
  12.     if ~addlib("rexxsupport.library", 0, -30, 0) then do
  13.         say "Couldn't access rexxsupport.library !"
  14.         exit 20
  15.     end 
  16. if ~show("L", "xferq.library") then
  17.     if ~addlib("xferq.library", 0, -30, 0) then do
  18.         say "Couldn't access xferq.library !"
  19.         exit 20
  20.     end
  21.     log=show('p','ROOFLOG')
  22.     script="Xrmv"
  23. parse upper arg siteaddress file .
  24. if arg()=0 then do
  25.     say "Usage:"
  26.     say "   Xrmv fullsiteaddress fullpathname"
  27.     exit
  28. end
  29. if pos(":",file)=0 then do
  30.     putlog("FileName must be a FullPath",10,10)   
  31.     exit 0    
  32. end
  33.  
  34.     site_address=XfqGetAddress(siteaddress)
  35.     QUERY.XQ_NAME=file
  36.     QUERY.XQ_SITE=site_address
  37.     work=NULL;work=XfqFindWork(QUERY)
  38.     if work=NULL then call PutLog("File "file" not in "siteaddress" queue",10,10)
  39.     else do
  40.         PutLog("Removing "file" from "siteaddress" queue",10,10)
  41.         call XfqRemoveWork(work)
  42.         call XfqDropObject(work)
  43.         call XfqFlushQueue(site_address)
  44.     end
  45.     call XfqDropObject(site_address)  
  46.     call XfqClose()
  47. exit
  48.  
  49. PutLog:  procedure expose log script
  50. if arg(3) < GetClip('STATUSLEVEL') then say arg(1)
  51. if arg(2) > GetClip('LOGLEVEL') then return 0
  52. if log then address 'ROOFLOG' 'logline' left(time(),5) script': 'arg(1)
  53. return 0
  54.